Done some testing with Module level Attr-DXL and discovered some nuances. Put the following in an Attr DXL named "dxlModuleInfo" that applies to both Objects and the Module as type 'Text'.
// test module level attribute with Attr-DXL
/* Put in a 'Text' attribute that applies to Module and Objects,
as an Attr-DXL
*/
Buffer buf = create()
string Name
AttrDef ad
int iLevel = level(obj)
//if (iLevel == 0) infoBox("start")
buf += "Identifier\t[" identifier(obj) "]\n"
buf += "Number \t[" number(obj) "]\n"
buf += "Level \t[" level(obj) "]\n"
if (iLevel == 0) obj."Object Text" = "Text"
//if (iLevel == 0) infoBox("before loop")
for ad in (current Module) do
{ if (!ad.object) continue
Name = ad.name
if (Name == attrDXLName) continue
// if (iLevel == 0) infoBox(Name)
buf += Name "\t[" (obj.Name) "]\n"
}
//if (iLevel == 0) infoBox("before Assign")
if (iLevel == 0) buf += "obj.AbsNo null: " (null obj."Absolute Number") "\n"
obj.attrDXLName = tempStringOf(buf)
delete(buf)
Module mod = current #include <utils/wipeattr.dxl> // Refresh DXL Attrs print mod."dxlModuleInfo" "\n" Attr__ attr = mod."Object Text" if (null attr) // then print "mod.Object Text is null\n" else print (mod."Object Text") "\n"
if (null obj) halt // not Attr-DXL
if (level(obj) == 0) halt // Module level attr-DXL
// v9.2.0.1 bug, cannot set AttrDXL values of a deleted object. Fixed in v9.2.0.2
if ( isDeleted(obj) and
length(doorsInfo(infoVersion)) >=7 and
(doorsInfo(infoVersion))[0:6] == "9.2.0.1") halt
llandale - Wed Mar 23 14:22:42 EDT 2011 |